{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "伪标签.ipynb",
      "provenance": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "e7j2_zP8M7pI"
      },
      "source": [
        "# 伪标签"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ttoERPclM-We"
      },
      "source": [
        "import pandas as pd"
      ],
      "execution_count": 43,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "xp0OdGDbODrb"
      },
      "source": [
        "df = pd.read_csv(\"newBert_589.csv\")"
      ],
      "execution_count": 44,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 434
        },
        "id": "BU9DJ5yoQXTG",
        "outputId": "07350c04-7a51-437e-8005-66cc14b9c9c9"
      },
      "source": [
        "df"
      ],
      "execution_count": 45,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>0</th>\n",
              "      <th>1</th>\n",
              "      <th>2</th>\n",
              "      <th>3</th>\n",
              "      <th>4</th>\n",
              "      <th>5</th>\n",
              "      <th>6</th>\n",
              "      <th>7</th>\n",
              "      <th>8</th>\n",
              "      <th>9</th>\n",
              "      <th>10</th>\n",
              "      <th>11</th>\n",
              "      <th>12</th>\n",
              "      <th>13</th>\n",
              "      <th>14</th>\n",
              "      <th>15</th>\n",
              "      <th>16</th>\n",
              "      <th>17</th>\n",
              "      <th>18</th>\n",
              "      <th>19</th>\n",
              "      <th>20</th>\n",
              "      <th>21</th>\n",
              "      <th>22</th>\n",
              "      <th>23</th>\n",
              "      <th>24</th>\n",
              "      <th>25</th>\n",
              "      <th>26</th>\n",
              "      <th>27</th>\n",
              "      <th>28</th>\n",
              "      <th>29</th>\n",
              "      <th>30</th>\n",
              "      <th>31</th>\n",
              "      <th>32</th>\n",
              "      <th>33</th>\n",
              "      <th>34</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>0.023881</td>\n",
              "      <td>0.019572</td>\n",
              "      <td>0.028504</td>\n",
              "      <td>0.021056</td>\n",
              "      <td>0.472094</td>\n",
              "      <td>0.016372</td>\n",
              "      <td>0.022226</td>\n",
              "      <td>0.010660</td>\n",
              "      <td>0.015124</td>\n",
              "      <td>0.016503</td>\n",
              "      <td>0.015861</td>\n",
              "      <td>0.018488</td>\n",
              "      <td>0.016094</td>\n",
              "      <td>0.014971</td>\n",
              "      <td>0.018717</td>\n",
              "      <td>0.027395</td>\n",
              "      <td>0.016709</td>\n",
              "      <td>0.020393</td>\n",
              "      <td>0.007884</td>\n",
              "      <td>0.015198</td>\n",
              "      <td>0.014248</td>\n",
              "      <td>0.014829</td>\n",
              "      <td>0.008858</td>\n",
              "      <td>0.009113</td>\n",
              "      <td>0.016052</td>\n",
              "      <td>0.018371</td>\n",
              "      <td>0.009083</td>\n",
              "      <td>0.012156</td>\n",
              "      <td>0.008686</td>\n",
              "      <td>0.014061</td>\n",
              "      <td>0.008626</td>\n",
              "      <td>0.015897</td>\n",
              "      <td>0.009922</td>\n",
              "      <td>0.007784</td>\n",
              "      <td>0.014612</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>0.030257</td>\n",
              "      <td>0.014868</td>\n",
              "      <td>0.025721</td>\n",
              "      <td>0.017982</td>\n",
              "      <td>0.018268</td>\n",
              "      <td>0.441842</td>\n",
              "      <td>0.008409</td>\n",
              "      <td>0.014865</td>\n",
              "      <td>0.012291</td>\n",
              "      <td>0.027203</td>\n",
              "      <td>0.021422</td>\n",
              "      <td>0.017275</td>\n",
              "      <td>0.016463</td>\n",
              "      <td>0.015820</td>\n",
              "      <td>0.010664</td>\n",
              "      <td>0.011256</td>\n",
              "      <td>0.012565</td>\n",
              "      <td>0.008016</td>\n",
              "      <td>0.012775</td>\n",
              "      <td>0.017265</td>\n",
              "      <td>0.016269</td>\n",
              "      <td>0.017244</td>\n",
              "      <td>0.057941</td>\n",
              "      <td>0.008738</td>\n",
              "      <td>0.011193</td>\n",
              "      <td>0.016144</td>\n",
              "      <td>0.017109</td>\n",
              "      <td>0.011842</td>\n",
              "      <td>0.014803</td>\n",
              "      <td>0.017261</td>\n",
              "      <td>0.010305</td>\n",
              "      <td>0.013838</td>\n",
              "      <td>0.009434</td>\n",
              "      <td>0.007597</td>\n",
              "      <td>0.015054</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>0.087079</td>\n",
              "      <td>0.022485</td>\n",
              "      <td>0.026062</td>\n",
              "      <td>0.034025</td>\n",
              "      <td>0.029744</td>\n",
              "      <td>0.012894</td>\n",
              "      <td>0.036504</td>\n",
              "      <td>0.036781</td>\n",
              "      <td>0.162438</td>\n",
              "      <td>0.016576</td>\n",
              "      <td>0.020909</td>\n",
              "      <td>0.018685</td>\n",
              "      <td>0.024154</td>\n",
              "      <td>0.015492</td>\n",
              "      <td>0.025458</td>\n",
              "      <td>0.026485</td>\n",
              "      <td>0.064758</td>\n",
              "      <td>0.022264</td>\n",
              "      <td>0.023396</td>\n",
              "      <td>0.015568</td>\n",
              "      <td>0.025229</td>\n",
              "      <td>0.019609</td>\n",
              "      <td>0.023695</td>\n",
              "      <td>0.012937</td>\n",
              "      <td>0.019829</td>\n",
              "      <td>0.015460</td>\n",
              "      <td>0.015241</td>\n",
              "      <td>0.020454</td>\n",
              "      <td>0.009324</td>\n",
              "      <td>0.028946</td>\n",
              "      <td>0.023099</td>\n",
              "      <td>0.013799</td>\n",
              "      <td>0.016883</td>\n",
              "      <td>0.016497</td>\n",
              "      <td>0.017240</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>0.039170</td>\n",
              "      <td>0.174060</td>\n",
              "      <td>0.161334</td>\n",
              "      <td>0.020907</td>\n",
              "      <td>0.028630</td>\n",
              "      <td>0.019431</td>\n",
              "      <td>0.012146</td>\n",
              "      <td>0.015889</td>\n",
              "      <td>0.053806</td>\n",
              "      <td>0.016470</td>\n",
              "      <td>0.013253</td>\n",
              "      <td>0.031334</td>\n",
              "      <td>0.013249</td>\n",
              "      <td>0.011006</td>\n",
              "      <td>0.014860</td>\n",
              "      <td>0.011602</td>\n",
              "      <td>0.063383</td>\n",
              "      <td>0.021866</td>\n",
              "      <td>0.013900</td>\n",
              "      <td>0.015783</td>\n",
              "      <td>0.012229</td>\n",
              "      <td>0.012134</td>\n",
              "      <td>0.006654</td>\n",
              "      <td>0.019037</td>\n",
              "      <td>0.009423</td>\n",
              "      <td>0.013602</td>\n",
              "      <td>0.012572</td>\n",
              "      <td>0.020864</td>\n",
              "      <td>0.015800</td>\n",
              "      <td>0.013911</td>\n",
              "      <td>0.013509</td>\n",
              "      <td>0.056994</td>\n",
              "      <td>0.014775</td>\n",
              "      <td>0.013985</td>\n",
              "      <td>0.012431</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>0.021714</td>\n",
              "      <td>0.381397</td>\n",
              "      <td>0.027425</td>\n",
              "      <td>0.010737</td>\n",
              "      <td>0.034612</td>\n",
              "      <td>0.018159</td>\n",
              "      <td>0.013342</td>\n",
              "      <td>0.019758</td>\n",
              "      <td>0.025158</td>\n",
              "      <td>0.030652</td>\n",
              "      <td>0.018636</td>\n",
              "      <td>0.026243</td>\n",
              "      <td>0.017486</td>\n",
              "      <td>0.015649</td>\n",
              "      <td>0.020762</td>\n",
              "      <td>0.014560</td>\n",
              "      <td>0.015470</td>\n",
              "      <td>0.032447</td>\n",
              "      <td>0.016494</td>\n",
              "      <td>0.018325</td>\n",
              "      <td>0.017373</td>\n",
              "      <td>0.015563</td>\n",
              "      <td>0.008368</td>\n",
              "      <td>0.020774</td>\n",
              "      <td>0.010216</td>\n",
              "      <td>0.015252</td>\n",
              "      <td>0.008768</td>\n",
              "      <td>0.020681</td>\n",
              "      <td>0.015027</td>\n",
              "      <td>0.014524</td>\n",
              "      <td>0.020299</td>\n",
              "      <td>0.017701</td>\n",
              "      <td>0.012778</td>\n",
              "      <td>0.014052</td>\n",
              "      <td>0.009599</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5999</th>\n",
              "      <td>0.053292</td>\n",
              "      <td>0.016842</td>\n",
              "      <td>0.031598</td>\n",
              "      <td>0.027396</td>\n",
              "      <td>0.035594</td>\n",
              "      <td>0.008251</td>\n",
              "      <td>0.375914</td>\n",
              "      <td>0.021270</td>\n",
              "      <td>0.015932</td>\n",
              "      <td>0.016458</td>\n",
              "      <td>0.026789</td>\n",
              "      <td>0.016552</td>\n",
              "      <td>0.014069</td>\n",
              "      <td>0.019293</td>\n",
              "      <td>0.019120</td>\n",
              "      <td>0.015463</td>\n",
              "      <td>0.013457</td>\n",
              "      <td>0.020984</td>\n",
              "      <td>0.017518</td>\n",
              "      <td>0.016583</td>\n",
              "      <td>0.021424</td>\n",
              "      <td>0.019160</td>\n",
              "      <td>0.012660</td>\n",
              "      <td>0.023915</td>\n",
              "      <td>0.019236</td>\n",
              "      <td>0.012510</td>\n",
              "      <td>0.012861</td>\n",
              "      <td>0.020195</td>\n",
              "      <td>0.009940</td>\n",
              "      <td>0.012667</td>\n",
              "      <td>0.008324</td>\n",
              "      <td>0.010034</td>\n",
              "      <td>0.011525</td>\n",
              "      <td>0.011138</td>\n",
              "      <td>0.012037</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6000</th>\n",
              "      <td>0.046010</td>\n",
              "      <td>0.011018</td>\n",
              "      <td>0.008075</td>\n",
              "      <td>0.040336</td>\n",
              "      <td>0.028408</td>\n",
              "      <td>0.007551</td>\n",
              "      <td>0.098660</td>\n",
              "      <td>0.008997</td>\n",
              "      <td>0.010190</td>\n",
              "      <td>0.012046</td>\n",
              "      <td>0.033433</td>\n",
              "      <td>0.024650</td>\n",
              "      <td>0.031805</td>\n",
              "      <td>0.018228</td>\n",
              "      <td>0.100555</td>\n",
              "      <td>0.021114</td>\n",
              "      <td>0.019646</td>\n",
              "      <td>0.022942</td>\n",
              "      <td>0.021643</td>\n",
              "      <td>0.018986</td>\n",
              "      <td>0.014591</td>\n",
              "      <td>0.011101</td>\n",
              "      <td>0.021528</td>\n",
              "      <td>0.023053</td>\n",
              "      <td>0.168330</td>\n",
              "      <td>0.012823</td>\n",
              "      <td>0.012367</td>\n",
              "      <td>0.009002</td>\n",
              "      <td>0.013393</td>\n",
              "      <td>0.009700</td>\n",
              "      <td>0.016458</td>\n",
              "      <td>0.013467</td>\n",
              "      <td>0.051154</td>\n",
              "      <td>0.013773</td>\n",
              "      <td>0.024967</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6001</th>\n",
              "      <td>0.053144</td>\n",
              "      <td>0.013074</td>\n",
              "      <td>0.036213</td>\n",
              "      <td>0.386758</td>\n",
              "      <td>0.029345</td>\n",
              "      <td>0.016951</td>\n",
              "      <td>0.016028</td>\n",
              "      <td>0.016913</td>\n",
              "      <td>0.022672</td>\n",
              "      <td>0.026479</td>\n",
              "      <td>0.031903</td>\n",
              "      <td>0.014780</td>\n",
              "      <td>0.024426</td>\n",
              "      <td>0.012941</td>\n",
              "      <td>0.013711</td>\n",
              "      <td>0.022051</td>\n",
              "      <td>0.014216</td>\n",
              "      <td>0.014812</td>\n",
              "      <td>0.014243</td>\n",
              "      <td>0.024982</td>\n",
              "      <td>0.022953</td>\n",
              "      <td>0.014309</td>\n",
              "      <td>0.012621</td>\n",
              "      <td>0.015877</td>\n",
              "      <td>0.017990</td>\n",
              "      <td>0.016437</td>\n",
              "      <td>0.010985</td>\n",
              "      <td>0.015859</td>\n",
              "      <td>0.003526</td>\n",
              "      <td>0.010597</td>\n",
              "      <td>0.010575</td>\n",
              "      <td>0.012585</td>\n",
              "      <td>0.010504</td>\n",
              "      <td>0.006516</td>\n",
              "      <td>0.013027</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6002</th>\n",
              "      <td>0.020997</td>\n",
              "      <td>0.016445</td>\n",
              "      <td>0.011981</td>\n",
              "      <td>0.011590</td>\n",
              "      <td>0.025437</td>\n",
              "      <td>0.013777</td>\n",
              "      <td>0.008036</td>\n",
              "      <td>0.015122</td>\n",
              "      <td>0.017314</td>\n",
              "      <td>0.013229</td>\n",
              "      <td>0.018123</td>\n",
              "      <td>0.018434</td>\n",
              "      <td>0.017833</td>\n",
              "      <td>0.011843</td>\n",
              "      <td>0.022311</td>\n",
              "      <td>0.207348</td>\n",
              "      <td>0.017895</td>\n",
              "      <td>0.039266</td>\n",
              "      <td>0.011935</td>\n",
              "      <td>0.034631</td>\n",
              "      <td>0.011983</td>\n",
              "      <td>0.012650</td>\n",
              "      <td>0.022290</td>\n",
              "      <td>0.012718</td>\n",
              "      <td>0.008185</td>\n",
              "      <td>0.223042</td>\n",
              "      <td>0.018269</td>\n",
              "      <td>0.013077</td>\n",
              "      <td>0.011472</td>\n",
              "      <td>0.013195</td>\n",
              "      <td>0.031685</td>\n",
              "      <td>0.018546</td>\n",
              "      <td>0.019951</td>\n",
              "      <td>0.012345</td>\n",
              "      <td>0.017044</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6003</th>\n",
              "      <td>0.026770</td>\n",
              "      <td>0.019323</td>\n",
              "      <td>0.027212</td>\n",
              "      <td>0.019448</td>\n",
              "      <td>0.390023</td>\n",
              "      <td>0.025906</td>\n",
              "      <td>0.030500</td>\n",
              "      <td>0.012631</td>\n",
              "      <td>0.016945</td>\n",
              "      <td>0.015841</td>\n",
              "      <td>0.018386</td>\n",
              "      <td>0.025835</td>\n",
              "      <td>0.019234</td>\n",
              "      <td>0.013113</td>\n",
              "      <td>0.017300</td>\n",
              "      <td>0.021488</td>\n",
              "      <td>0.018365</td>\n",
              "      <td>0.016511</td>\n",
              "      <td>0.011090</td>\n",
              "      <td>0.020989</td>\n",
              "      <td>0.018778</td>\n",
              "      <td>0.017387</td>\n",
              "      <td>0.016424</td>\n",
              "      <td>0.010873</td>\n",
              "      <td>0.016611</td>\n",
              "      <td>0.023371</td>\n",
              "      <td>0.011120</td>\n",
              "      <td>0.013543</td>\n",
              "      <td>0.011079</td>\n",
              "      <td>0.024161</td>\n",
              "      <td>0.011288</td>\n",
              "      <td>0.020312</td>\n",
              "      <td>0.012116</td>\n",
              "      <td>0.008375</td>\n",
              "      <td>0.017650</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>6004 rows × 35 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "             0         1         2  ...        32        33        34\n",
              "0     0.023881  0.019572  0.028504  ...  0.009922  0.007784  0.014612\n",
              "1     0.030257  0.014868  0.025721  ...  0.009434  0.007597  0.015054\n",
              "2     0.087079  0.022485  0.026062  ...  0.016883  0.016497  0.017240\n",
              "3     0.039170  0.174060  0.161334  ...  0.014775  0.013985  0.012431\n",
              "4     0.021714  0.381397  0.027425  ...  0.012778  0.014052  0.009599\n",
              "...        ...       ...       ...  ...       ...       ...       ...\n",
              "5999  0.053292  0.016842  0.031598  ...  0.011525  0.011138  0.012037\n",
              "6000  0.046010  0.011018  0.008075  ...  0.051154  0.013773  0.024967\n",
              "6001  0.053144  0.013074  0.036213  ...  0.010504  0.006516  0.013027\n",
              "6002  0.020997  0.016445  0.011981  ...  0.019951  0.012345  0.017044\n",
              "6003  0.026770  0.019323  0.027212  ...  0.012116  0.008375  0.017650\n",
              "\n",
              "[6004 rows x 35 columns]"
            ]
          },
          "metadata": {},
          "execution_count": 45
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "kTvVpEKGOJ9y"
      },
      "source": [
        "dfList = df.values.tolist()"
      ],
      "execution_count": 46,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "iDv3rwm5PamJ",
        "outputId": "728fa955-f46f-46a3-81e6-7d9ca4be1545"
      },
      "source": [
        "len(dfList)"
      ],
      "execution_count": 47,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "6004"
            ]
          },
          "metadata": {},
          "execution_count": 47
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 387
        },
        "id": "CPE6NeoiQusg",
        "outputId": "4ebf17a8-2a87-42e1-c302-42952030098c"
      },
      "source": [
        "import seaborn as sns\n",
        "sns.displot(argMaxList)"
      ],
      "execution_count": 28,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "<seaborn.axisgrid.FacetGrid at 0x7f2522d09390>"
            ]
          },
          "metadata": {},
          "execution_count": 28
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAFgCAYAAACFYaNMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAWCUlEQVR4nO3df7DldX3f8edLRMBIisSbnVtYCzFrrViy2CuamOkoVrIyk4CNoTitooPZpGXbOnEcMXQmSVumpk2gprV01mBZOkYE4481IQREEsdMAFeyLixouyoMu3OEBdG9hEgK++4f57t4Xe/ee+7ufs/n3Hufj5kz93s+38/37PvrXV/75f39cVJVSJLG7zmtC5Ck1coAlqRGDGBJasQAlqRGDGBJauS5rQs4Ehs2bKibb765dRmStJjMN7isj4AfffTR1iVI0mFb1gEsScuZASxJjRjAktSIASxJjRjAktSIASxJjRjAktSIASxJjRjAktSIASxJjRjAktSIASxJjRjAktSIASxJjSzr5wHr6DrjzPUMBoMF50xPT7Nzx/YxVSStbAbwCnC0gnMwGHDuFZ9ecM4tl1+w5Pokzc8AXgEMTml5sgcsSY0YwJLUiAEsSY3YA14l9s0+wclTaxaZMzumaiSBAbxq1P79i56ou3HTOWOqRhL02IJIcnySu5J8JcnOJL/VjV+b5JtJtnev9d14kvxekl1JdiR5ZV+1SdIk6PMI+CngnKp6IsmxwBeT/Em37r1V9YmD5r8JWNe9Xg1c3f2UpBWptyPgGnqie3ts96oFNjkfuK7b7g7gpCTTfdUnSa31ehVEkmOSbAceAW6tqju7VVd0bYarkhzXjZ0CPDRn893d2MGfuTHJtiTb9u7d22f5ktSrXgO4qp6pqvXAqcDZSV4BvB94GfAq4GTgfUv8zM1VNVNVM1NTU0e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DMJCPrtYN8eXyYvgv4jeA0/l+4/6MQ8y9lsk8CbfoPgBnMTxBsa51vUewD+vmLP88sK113Yfz96ib/2dM3km4UX4H03OW3wzc0bruJda/AdjSLb+IYcvix456La3/x1hOL+A8hv8Sfh24vBv79wyPFAFexfBfzr8GHgN2tq75MPbhc8DDwPbutbV1zYexDx8Ednb1375QwE1i/QfNnbgAHvF38J+638FXut/By1rXvMT6w7AVdB9wD3BRH3V4K7IkNWIPWJIaMYAlqREDWJIaMYAlqREDWJIaMYAlqREDWJIa+f8xTKu0+967KgAAAABJRU5ErkJggg==\n",
            "text/plain": [
              "<Figure size 360x360 with 1 Axes>"
            ]
          },
          "metadata": {
            "needs_background": "light"
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Jo35fEP9PeI8"
      },
      "source": [
        "indexList = []\n",
        "levelIndexList = []\n",
        "for i in range(len(dfList)):\n",
        "    tmpMax = max(dfList[i])\n",
        "    if tmpMax >0.354:\n",
        "        indexList.append(i)\n",
        "        levelIndexList.append(dfList[i].index(tmpMax))"
      ],
      "execution_count": 51,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "iQjD39ltfY79",
        "outputId": "1e449793-5771-48ca-ab75-944c801d8047"
      },
      "source": [
        "len(levelIndexList)"
      ],
      "execution_count": 54,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "1498"
            ]
          },
          "metadata": {},
          "execution_count": 54
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "jl0iwgc9pgsJ"
      },
      "source": [
        "dic={}\n",
        "for i in levelIndexList:\n",
        "    label = labelMap[i]\n",
        "    dic[label] = dic.get(label,0)+1"
      ],
      "execution_count": 72,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "US71NOwSqScv",
        "outputId": "441ae7da-20a6-41cb-bd7d-8a7dfdcf2ac3"
      },
      "source": [
        "dic"
      ],
      "execution_count": 73,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "{'1-1': 54,\n",
              " '1-10': 61,\n",
              " '1-4': 94,\n",
              " '1-9': 35,\n",
              " '2-11': 14,\n",
              " '2-14': 13,\n",
              " '2-17': 2,\n",
              " '2-2': 116,\n",
              " '2-25': 56,\n",
              " '2-3': 167,\n",
              " '2-33': 158,\n",
              " '2-6': 251,\n",
              " '4-7': 53,\n",
              " '5-12': 23,\n",
              " '5-24': 4,\n",
              " '5-30': 90,\n",
              " '5-35': 23,\n",
              " '6-13': 4,\n",
              " '6-15': 151,\n",
              " '6-19': 26,\n",
              " '6-21': 25,\n",
              " '6-28': 13,\n",
              " '6-29': 2,\n",
              " '6-31': 7,\n",
              " '6-34': 28,\n",
              " '6-8': 28}"
            ]
          },
          "metadata": {},
          "execution_count": 73
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "M_ulSKybQm6I",
        "outputId": "6b4ce45e-34e7-4fdd-bf07-c3e58b3ef28f"
      },
      "source": [
        "max(argMaxList)"
      ],
      "execution_count": 27,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "0.61487573"
            ]
          },
          "metadata": {},
          "execution_count": 27
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Xv9fL9oogIYd"
      },
      "source": [
        "def get_labels(label_file):\n",
        "    return [label.strip() for label in open(label_file, 'r', encoding='utf-8')]"
      ],
      "execution_count": 57,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "hbCJ4NRdgN5V"
      },
      "source": [
        "labelMap = get_labels(label_2_dir)"
      ],
      "execution_count": 65,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "nD0n-oCsSZOh"
      },
      "source": [
        "label_2_dir = \"labels_level_2.txt\""
      ],
      "execution_count": 56,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "JZcvK7XmiX8d"
      },
      "source": [
        "with open(\"test.txt\", encoding=\"utf-8\") as f:\n",
        "    lines = [line for line in f.read().splitlines() if (len(line)>0 and not line.isspace())]"
      ],
      "execution_count": 59,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "irQNtDE6lxHL"
      },
      "source": [
        "newLine1498=[]\n",
        "for i in range(len(indexList)):\n",
        "    tmpIndex = indexList[i]\n",
        "    tmpLabel = levelIndexList[i]\n",
        "    tmpLine = lines[tmpIndex]\n",
        "    newLine = tmpLine+\",\"+labelMap[tmpLabel]\n",
        "    newLine1498.append(newLine)"
      ],
      "execution_count": 68,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "OSTkub6xnZ8z"
      },
      "source": [
        "with open('pseudoLabel_1498.txt', 'w') as the_file:\n",
        "    for line in newLine1498:\n",
        "        the_file.write(line+\"\\n\")"
      ],
      "execution_count": 71,
      "outputs": []
    }
  ]
}